package com.lin.cloud.disk.common.enums;

/**
 * 响应枚举，包括响应码和响应信息
 * @author ljc
 */
public enum EResponseCode implements ResponseCode {
    /**
     * 响应码
     */
    SUCCESS("00000", "成功"),
    FAIL("11111", "失败"),
    SUCCESS_CODE("200", "正确"),
    PARAM_ERROR_CODE("400", "参数错误"),
    LOGON_FAIL("401", "登录失败"),
    TOKEN_TIMEOUT_CODE("402", "token过期"),
    NO_AUTH_CODE("403", "禁止访问"),
    NOT_FOUND("404", "访问资源不存在,请稍后重试"),
    SERVER_ERROR_CODE("500", "服务器错误,请稍后重试"),
    DOWNGRADE("429", "当前访问流量过大,请稍后重试"),
    SYSTEM_SIGN_ERROR("90000", "签名错误"),
    SYSTEM_ERROR("90001", "系统错误"),
    SYSTEM_PARAM_ERROR("90002", "参数错误"),
    SYSTEM_REMOTE_SERVICE_ERROR("90003", "远程方法调用异常"),
    SYSTEM_METHOD_NOT_ALLOWED("90004", "请求方法不支持"),
    SYSTEM_REQUEST_FAILE("90005", "数据传输格式不支持"),
    ILLEGAL_SECRET_REQUEST("90006", "非法秘钥请求"),
    ILLEGAL_REQUEST("90007", "非法请求"),
    SYSTEM_RECORD_NOT_EXIST("90013", "搜索无结果"),
    /**
     * 处理业务逻辑错误时提示,主要使用于
     */
    SYSTEM_BUSINESS_ERROR("90014", "业务繁忙,请稍后重试"),
    SYSTEM_PARAM_MISSING("90015", "缺少参数"),
    SYSTEM_PARAM_ID_MISSING("90016", "缺少主键"),
    SYSTEM_BUSY_ERROR("90017", "系统繁忙,请稍后重试"),
    ILLEGAL_PARAMETER("90018", "非法参数"),
    READ_TIMEOUT_ERROR("90019", "网络请求超时,请稍后重试"),
    THIRD_CHANNEL_ERROR("90020", "访问第三方api失败,请稍后重试"),
    AUTHORIZATION_BEARER_ERROR("90021", "缺少Bearer请求头"),
    BEARER_PARAM_ERROR("90022", "Bearer缺少参数"),
    NO_MORE_MESSAGE("90023", "没有更多的数据"),
    GATEWAY_FEATURE_TRUE_MESSAGE("90024", "系统正在升级维护中,敬请期待~"),
    FEATURES_PROTECTING("90025","本功能维护中，我们会尽快恢复哒~"),
    NOT_LOGIN("90026","请先登录,才能使用哦~"),
    GOODS_NO_EXIST("90027","商品已下架"),
    CAPTCHA_TIMEOUT("91001", "验证码失效"),
    CAPTCHA_FAIL("91002", "验证码不正确"),

    USER_NOT_PHONE("93002", "用户没有绑定手机号");

    /**
     * 响应码
     */
    private String code;
    /**
     * 响应信息
     */
    private String describe;

    EResponseCode(String value, String describe) {
        this.code = value;
        this.describe = describe;
    }

    EResponseCode(String code) {
        this.code = code;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getDescribe() {
        return describe;
    }
}
